//
//  ZGSReadModel.m
//  MapleLeaf
//
//  Created by WangZe on 15/11/28.
//  Copyright © 2015年 AntennaBabyTeam. All rights reserved.
//

#import "ZGSReadModel.h"

@implementation ZGSReadModel

#pragma mark - code

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:self.rId forKey:@"rId"];
    [aCoder encodeObject:self.albumId forKey:@"albumId"];
    [aCoder encodeObject:self.price forKey:@"price"];
    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeObject:self.orderNumber forKey:@"orderNumber"];
    
    [aCoder encodeObject:self.size forKey:@"size"];
    [aCoder encodeObject:self.page forKey:@"page"];
    [aCoder encodeObject:self.type forKey:@"type"];
    [aCoder encodeObject:self.url forKey:@"url"];
    [aCoder encodeObject:self.onlineUrl forKey:@"onlineUrl"];
    [aCoder encodeObject:self.isLook forKey:@"isLook"];
    [aCoder encodeObject:self.unLock forKey:@"unLock"];
    [aCoder encodeObject:self.readArr forKey:@"readArr"];
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        self.rId = [aDecoder decodeObjectForKey:@"rId"];
        self.albumId = [aDecoder decodeObjectForKey:@"albumId"];
        self.price = [aDecoder decodeObjectForKey:@"price"];
        self.name = [aDecoder decodeObjectForKey:@"name"];
        self.page = [aDecoder decodeObjectForKey:@"page"];
        self.orderNumber = [aDecoder decodeObjectForKey:@"orderNumber"];
        self.size = [aDecoder decodeObjectForKey:@"size"];
        self.type = [aDecoder decodeObjectForKey:@"type"];
        self.url = [aDecoder decodeObjectForKey:@"url"];
        self.onlineUrl = [aDecoder decodeObjectForKey:@"onlineUrl"];
        self.isLook = [aDecoder decodeObjectForKey:@"isLook"];
        self.unLock = [aDecoder decodeObjectForKey:@"unLock"];
        self.readArr = [aDecoder decodeObjectForKey:@"readArr"];
    }
    
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.rId = value;
    }
}

@end
